home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Time::localtime.z / Time::localtime
Encoding:
Text File  |  1998-10-30  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTiiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))                                          TTTTiiiimmmmeeee::::::::llllooooccccaaaallllttttiiiimmmmeeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Time::localtime - by-name interface to Perl's built-in _l_o_c_a_l_t_i_m_e()
  10.      function
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       use Time::localtime;
  14.       printf "Year is %d\n", localtime->year() + 1900;
  15.  
  16.       $now = ctime();
  17.  
  18.       use Time::localtime;
  19.       use File::stat;
  20.       $date_string = ctime(stat($file)->mtime);
  21.  
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      This module's default exports override the core _l_o_c_a_l_t_i_m_e() function,
  25.      replacing it with a version that returns "Time::tm" objects.  This object
  26.      has methods that return the similarly named structure field name from the
  27.      C's tm structure from _t_i_m_e._h; namely sec, min, hour, mday, mon, year,
  28.      wday, yday, and isdst.
  29.  
  30.      You may also import all the structure fields directly into your namespace
  31.      as regular variables using the :FIELDS import tag.  (Note that this still
  32.      overrides your core functions.)  Access these fields as variables named
  33.      with a preceding tm_ in front their method names.  Thus, $tm_obj->_m_d_a_y()
  34.      corresponds to $tm_mday if you import the fields.
  35.  
  36.      The _c_t_i_m_e() funtion provides a way of getting at the scalar sense of the
  37.      original _C_O_R_E::_l_o_c_a_l_t_i_m_e() function.
  38.  
  39.      To access this functionality without the core overrides, pass the use an
  40.      empty import list, and then access function functions with their full
  41.      qualified names.  On the other hand, the built-ins are still available
  42.      via the CORE:: pseudo-package.
  43.  
  44. NNNNOOOOTTTTEEEE
  45.      While this class is currently implemented using the Class::Struct module
  46.      to build a struct-like class, you shouldn't rely upon this.
  47.  
  48. AAAAUUUUTTTTHHHHOOOORRRR
  49.      Tom Christiansen
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.